<?php
/**
 * Created by PhpStorm.
 * User: SUNHUATAO
 * Desc: 前台招聘控制器
 */
namespace App\Modules\Home\Http\Controllers;

use App\Http\Controllers\BasicController;
use App\Modules\Manage\Model\InviteManageModel;
use Illuminate\Http\Request;
class InviteController extends BasicController
{
    public function __construct()
    {
        parent::__construct();
        $this->initTheme('home');
    }

    /**
     * @desc 招聘列表
     * @param Request $request
     * @return mixed
     */
    public function talentsHr(Request $request)
    {
        $merge = $request->all();
//        var_export($merge);die;
        $list = InviteManageModel::where('is_delete',0)->select('id','position','money','updated_at')->orderBy('updated_at','desc')->paginate(8);
//       var_export($list->toArray());die;
        $aa =InviteManageModel::select('*')->get();
        $aa ->toArray();

        $listArr = $list->toArray()['data'];
        $data = [
            'merge' => $merge,
            'list'  => $list,
            'listArr'=> $listArr
        ];

        $this->theme->setTitle('人才招聘');
        return $this->theme->scope('home/talentsHr',$data)->render();
    }
    public function talentsInfo($id)
    {
        $info = InviteManageModel::where('id',$id)->first()->toArray();
        $data = ['info'=>$info];
        $this->theme->setTitle('职位详情');
        return $this->theme->scope('home/talentsInfo',$data)->render();
    }
}